<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../../css/aui.css">
    <link rel="stylesheet" type="text/css" href="../../css/aui-slide.css">
    <link rel="stylesheet" type="text/css" href="../../css/api.css">
    <link rel="stylesheet" type="text/css" href="../../css/common.css">
    <script type="text/javascript" src="../../script/api.js"></script>
</head>

<body style="background-color: #dcdcdc;">
    <header class="aui-bar aui-bar-nav" style="background-color: #f7911b;height: 3rem;">
        <span class="aui-iconfont aui-icon-left aui-pull-left"  tapmode onclick="api.closeWin();"></span>
        <div class="aui-title">交易记录</div>
        
    </header>
    <div style="display: flex;flex-direction: column;" id="jiaoyi_jilu">
        

    </div>

   
</body>
<script type="text/javascript">
 apiready = function() {
        var token = $api.getStorage('token');
       
            var token = {
                token: token
            };
        api.ajax({
            url: 'http://www.mk517.com/webApi/mingxi.php',
            method: 'post',
            "headers": {
                "Content-Type": "application/json"
            },
            dataType: "json",
            data: {
                body: token
            }
        }, function(ret, err) {
            // alert(JSON.stringify(ret));
           
                if(ret){
                    for( i in ret.data)
                    {
                        if(ret.data[i]['sta']==1){
                        $api.byId('jiaoyi_jilu').innerHTML += 
                        '<div style="background-color:#fff;width:100%;height:3rem;display:flex;flex-direction: row;justify-content:space-between;">'+
                        '<div style="line-height:3rem;margin-left:0.5rem;width:3.5rem;">返利</div>'+
                        '<div style="line-height:3rem;color: #3bff36;">'+'+'+ret.data[i]['jifenbao']/100+'元</div>'+
                        '<div style="float:right;margin-right:0rem;width:4.5rem;display: flex; text-align: center;line-height:1.5rem;opacity: 0.6;">'+ret.data[i]['addtime']+'</div></div>'

                        }else if(ret.data[i]['sta']==0){
                        $api.byId('jiaoyi_jilu').innerHTML += 
                        '<div style="background-color:#fff;width:100%;height:3rem;display:flex;flex-direction: row;justify-content:space-between;">'+
                        '<div style="line-height:3rem;margin-left:0.5rem;width:3.5rem;">提现</div>'+
                        '<div style="line-height:3rem;color: #ff0000;">'+''+ret.data[i]['jifenbao']/100+'元</div>'+
                        '<div style="float:right;margin-right:0rem;width:4.5rem;display: flex; text-align: center;line-height:1.5rem;opacity: 0.6;">'+ret.data[i]['addtime']+'</div></div>'

                        }else{

                        }

                       
                        // alert(ret.data[i]['sta']);
                        // alert(ret.data[i]['jifenbao']);
                        // alert(ret.data[i]['addtime']);
                    }
 
                
             }else {
                alert(JSON.stringify(err));
            }
        });


        
    }
</script>

</html>
